Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[JAVA] Kompilacja


Rekomendowane odpowiedzi

Opublikowano

Witam. Mam plik java a w nim zawarte kilka linjek 'insert nazwa drugiego pliku' podczas kompilacji pliku, wykazuje błąd w linijkach insert.

Jak to naprawić?

Chodzi o to że kompilator nie może znaleźć tamtych plików? *_*

Opublikowano

O, ciesze się, że ktoś pomoże :))

łap.

Zmm4TjL.jpg

 

 

I tak wygląda cały log. does not exist itp....

Rozumiem że nie znajduje pliku...

Wklejam tylko jeden plik .java.

 

 

Treść Plugin.java:

 

/* */ package org.bukkit.craftbukkit.v1_4_R1;

/* */

/* */ import com.avaje.ebean.config.DataSourceConfig;

/* */ import com.avaje.ebean.config.ServerConfig;

/* */ import com.avaje.ebean.config.dbplatform.DatabasePlatform;

/* */ import com.avaje.ebean.config.dbplatform.DbDdlSyntax;

/* */ import com.avaje.ebean.config.dbplatform.SQLitePlatform;

/* */ import com.avaje.ebeaninternal.server.lib.sql.TransactionIsolation;

/* */ import com.google.common.collect.ImmutableList;

/* */ import com.google.common.collect.MapMaker;

/* */ import java.io.File;

/* */ import java.io.FileInputStream;

/* */ import java.io.FileNotFoundException;

/* */ import java.io.IOException;

/* */ import java.io.PrintStream;

/* */ import java.util.ArrayList;

/* */ import java.util.Arrays;

/* */ import java.util.Collections;

/* */ import java.util.HashSet;

/* */ import java.util.Iterator;

/* */ import java.util.LinkedHashMap;

/* */ import java.util.LinkedHashSet;

/* */ import java.util.List;

/* */ import java.util.Map;

/* */ import java.util.Set;

/* */ import java.util.UUID;

/* */ import java.util.logging.Level;

/* */ import java.util.logging.Logger;

/* */ import net.minecraft.server.v1_4_R1.BanEntry;

/* */ import net.minecraft.server.v1_4_R1.BanList;

/* */ import net.minecraft.server.v1_4_R1.ChunkCoordinates;

/* */ import net.minecraft.server.v1_4_R1.ChunkProviderServer;

/* */ import net.minecraft.server.v1_4_R1.ConvertProgressUpdater;

/* */ import net.minecraft.server.v1_4_R1.Convertable;

/* */ import net.minecraft.server.v1_4_R1.CraftingManager;

/* */ import net.minecraft.server.v1_4_R1.DedicatedPlayerList;

/* */ import net.minecraft.server.v1_4_R1.DedicatedServer;

/* */ import net.minecraft.server.v1_4_R1.EntityPlayer;

/* */ import net.minecraft.server.v1_4_R1.EntityTracker;

/* */ import net.minecraft.server.v1_4_R1.EnumGamemode;

/* */ import net.minecraft.server.v1_4_R1.ExceptionWorldConflict;

/* */ import net.minecraft.server.v1_4_R1.ICommandListener;

/* */ import net.minecraft.server.v1_4_R1.IProgressUpdate;

/* */ import net.minecraft.server.v1_4_R1.Item;

/* */ import net.minecraft.server.v1_4_R1.ItemWorldMap;

/* */ import net.minecraft.server.v1_4_R1.MinecraftServer;

/* */ import net.minecraft.server.v1_4_R1.MobEffectList;

/* */ import net.minecraft.server.v1_4_R1.PlayerConnection;

/* */ import net.minecraft.server.v1_4_R1.PlayerList;

/* */ import net.minecraft.server.v1_4_R1.PropertyManager;

/* */ import net.minecraft.server.v1_4_R1.RecipesFurnace;

/* */ import net.minecraft.server.v1_4_R1.ServerCommand;

/* */ import net.minecraft.server.v1_4_R1.ServerNBTManager;

/* */ import net.minecraft.server.v1_4_R1.WorldData;

/* */ import net.minecraft.server.v1_4_R1.WorldLoaderServer;

/* */ import net.minecraft.server.v1_4_R1.WorldManager;

/* */ import net.minecraft.server.v1_4_R1.WorldMap;

/* */ import net.minecraft.server.v1_4_R1.WorldMapCollection;

/* */ import net.minecraft.server.v1_4_R1.WorldNBTStorage;

/* */ import net.minecraft.server.v1_4_R1.WorldServer;

/* */ import net.minecraft.server.v1_4_R1.WorldSettings;

/* */ import org.apache.commons.lang.Validate;

/* */ import org.bukkit.Bukkit;

/* */ import org.bukkit.ChatColor;

/* */ import org.bukkit.GameMode;

/* */ import org.bukkit.OfflinePlayer;

/* */ import org.bukkit.Server;

/* */ import org.bukkit.Warning.WarningState;

/* */ import org.bukkit.World;

/* */ import org.bukkit.World.Environment;

/* */ import org.bukkit.WorldCreator;

/* */ import org.bukkit.command.Command;

/* */ import org.bukkit.command.CommandException;

/* */ import org.bukkit.command.CommandSender;

/* */ import org.bukkit.command.ConsoleCommandSender;

/* */ import org.bukkit.command.PluginCommand;

/* */ import org.bukkit.command.SimpleCommandMap;

/* */ import org.bukkit.configuration.ConfigurationSection;

/* */ import org.bukkit.configuration.file.YamlConfiguration;

/* */ import org.bukkit.configuration.file.YamlConfigurationOptions;

/* */ import org.bukkit.configuration.serialization.ConfigurationSerialization;

/* */ import org.bukkit.conversations.Conversable;

/* */ import org.bukkit.craftbukkit.Main;

/* */ import org.bukkit.craftbukkit.libs.jline.console.ConsoleReader;

/* */ import org.bukkit.craftbukkit.libs.joptsimple.OptionSet;

/* */ import org.bukkit.craftbukkit.v1_4_R1.help.SimpleHelpMap;

/* */ import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftFurnaceRecipe;

/* */ import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftInventoryCustom;

/* */ import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftItemFactory;

/* */ import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftRecipe;

/* */ import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftShapedRecipe;

/* */ import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftShapelessRecipe;

/* */ import org.bukkit.craftbukkit.v1_4_R1.inventory.RecipeIterator;

/* */ import org.bukkit.craftbukkit.v1_4_R1.map.CraftMapView;

/* */ import org.bukkit.craftbukkit.v1_4_R1.metadata.EntityMetadataStore;

/* */ import org.bukkit.craftbukkit.v1_4_R1.metadata.PlayerMetadataStore;

/* */ import org.bukkit.craftbukkit.v1_4_R1.metadata.WorldMetadataStore;

/* */ import org.bukkit.craftbukkit.v1_4_R1.potion.CraftPotionBrewer;

/* */ import org.bukkit.craftbukkit.v1_4_R1.scheduler.CraftScheduler;

/* */ import org.bukkit.craftbukkit.v1_4_R1.updater.ArtifactDetails;

/* */ import org.bukkit.craftbukkit.v1_4_R1.updater.AutoUpdater;

/* */ import org.bukkit.craftbukkit.v1_4_R1.updater.BukkitDLUpdaterService;

/* */ import org.bukkit.craftbukkit.v1_4_R1.util.DatFileFilter;

/* */ import org.bukkit.craftbukkit.v1_4_R1.util.Versioning;

/* */ import org.bukkit.entity.Player;

/* */ import org.bukkit.event.inventory.InventoryType;

/* */ import org.bukkit.event.player.PlayerChatTabCompleteEvent;

/* */ import org.bukkit.event.world.WorldInitEvent;

/* */ import org.bukkit.event.world.WorldLoadEvent;

/* */ import org.bukkit.event.world.WorldSaveEvent;

/* */ import org.bukkit.event.world.WorldUnloadEvent;

/* */ import org.bukkit.generator.ChunkGenerator;

/* */ import org.bukkit.help.HelpMap;

/* */ import org.bukkit.inventory.FurnaceRecipe;

/* */ import org.bukkit.inventory.Inventory;

/* */ import org.bukkit.inventory.InventoryHolder;

/* */ import org.bukkit.inventory.Recipe;

/* */ import org.bukkit.inventory.ShapedRecipe;

/* */ import org.bukkit.inventory.ShapelessRecipe;

/* */ import org.bukkit.permissions.Permissible;

/* */ import org.bukkit.permissions.Permission;

/* */ import org.bukkit.plugin.Plugin;

/* */ import org.bukkit.plugin.PluginDescriptionFile;

/* */ import org.bukkit.plugin.PluginLoadOrder;

/* */ import org.bukkit.plugin.PluginManager;

/* */ import org.bukkit.plugin.ServicesManager;

/* */ import org.bukkit.plugin.SimplePluginManager;

/* */ import org.bukkit.plugin.SimpleServicesManager;

/* */ import org.bukkit.plugin.java.JavaPluginLoader;

/* */ import org.bukkit.plugin.messaging.Messenger;

/* */ import org.bukkit.plugin.messaging.StandardMessenger;

/* */ import org.bukkit.potion.Potion;

/* */ import org.bukkit.potion.PotionEffectType;

/* */ import org.bukkit.scheduler.BukkitWorker;

/* */ import org.bukkit.util.StringUtil;

/* */ import org.bukkit.util.permissions.DefaultPermissions;

/* */ import org.yaml.snakeyaml.Yaml;

/* */ import org.yaml.snakeyaml.constructor.SafeConstructor;

/* */ import org.yaml.snakeyaml.error.MarkedYAMLException;

/* */

/* */ public final class CraftServer

/* */ implements Server

/* */ {

/* 137 */ private final String serverName = "CraftBukkit";

/* */ private final String serverVersion;

/* 139 */ private final String bukkitVersion = Versioning.getBukkitVersion();

/* 140 */ private final ServicesManager servicesManager = new SimpleServicesManager();

/* 141 */ private final CraftScheduler scheduler = new CraftScheduler();

/* 142 */ private final SimpleCommandMap commandMap = new SimpleCommandMap(this);

/* 143 */ private final SimpleHelpMap helpMap = new SimpleHelpMap(this);

/* 144 */ private final StandardMessenger messenger = new StandardMessenger();

/* 145 */ private final PluginManager pluginManager = new SimplePluginManager(this, this.commandMap);

/* */ protected final MinecraftServer console;

/* */ protected final DedicatedPlayerList playerList;

/* 148 */ private final Map worlds = new LinkedHashMap();

/* */ private YamlConfiguration configuration;

/* 150 */ private final Yaml yaml = new Yaml(new SafeConstructor());

/* 151 */ private final Map offlinePlayers = new MapMaker().softValues().makeMap();

/* */ private final AutoUpdater updater;

/* 153 */ private final EntityMetadataStore entityMetadata = new EntityMetadataStore();

/* 154 */ private final PlayerMetadataStore playerMetadata = new PlayerMetadataStore();

/* 155 */ private final WorldMetadataStore worldMetadata = new WorldMetadataStore();

/* 156 */ private int monsterSpawn = -1;

/* 157 */ private int animalSpawn = -1;

/* 158 */ private int waterAnimalSpawn = -1;

/* 159 */ private int ambientSpawn = -1;

/* 160 */ public int chunkGCPeriod = -1;

/* 161 */ public int chunkGCLoadThresh = 0;

/* */ private File container;

/* 163 */ private Warning.WarningState warningState = Warning.WarningState.DEFAULT;

/* 164 */ private final BooleanWrapper online = new BooleanWrapper(null);

/* */

/* */ public CraftServer(MinecraftServer console, PlayerList playerList)

/* */ {

/* 176 */ this.console = console;

/* 177 */ this.playerList = ((DedicatedPlayerList)playerList);

/* 178 */ this.serverVersion = CraftServer.class.getPackage().getImplementationVersion();

/* 179 */ this.online.value = console.getPropertyManager().getBoolean("online-mode", true);

/* */

/* 181 */ Bukkit.setServer(this);

/* */

/* 184 */ net.minecraft.server.v1_4_R1.Enchantment.DAMAGE_ALL.getClass();

/* 185 */ org.bukkit.enchantments.Enchantment.stopAcceptingRegistrations();

/* */

/* 187 */ Potion.setPotionBrewer(new CraftPotionBrewer());

/* 188 */ MobEffectList.BLINDNESS.getClass();

/* 189 */ PotionEffectType.stopAcceptingRegistrations();

/* */

/* 192 */ if (!Main.useConsole) {

/* 193 */ getLogger().info("Console input is disabled due to --noconsole command argument");

/* */ }

/* */

/* 196 */ this.configuration = YamlConfiguration.loadConfiguration(getConfigFile());

/* 197 */ this.configuration.options().copyDefaults(true);

/* 198 */ this.configuration.setDefaults(YamlConfiguration.loadConfiguration(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml")));

/* 199 */ saveConfig();

/* 200 */ ((SimplePluginManager)this.pluginManager).useTimings(this.configuration.getBoolean("settings.plugin-profiling"));

/* 201 */ this.monsterSpawn = this.configuration.getInt("spawn-limits.monsters");

/* 202 */ this.animalSpawn = this.configuration.getInt("spawn-limits.animals");

/* 203 */ this.waterAnimalSpawn = this.configuration.getInt("spawn-limits.water-animals");

/* 204 */ this.ambientSpawn = this.configuration.getInt("spawn-limits.ambient");

/* 205 */ console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");

/* 206 */ this.warningState = Warning.WarningState.value(this.configuration.getString("settings.deprecated-verbose"));

/* 207 */ this.chunkGCPeriod = this.configuration.getInt("chunk-gc.period-in-ticks");

/* 208 */ this.chunkGCLoadThresh = this.configuration.getInt("chunk-gc.load-threshold");

/* */

/* 210 */ this.updater = new AutoUpdater(new BukkitDLUpdaterService(this.configuration.getString("auto-updater.host")), getLogger(), this.configuration.getString("auto-updater.preferred-channel"));

/* 211 */ this.updater.setEnabled(this.configuration.getBoolean("auto-updater.enabled"));

/* 212 */ this.updater.setSuggestChannels(this.configuration.getBoolean("auto-updater.suggest-channels"));

/* 213 */ this.updater.getOnBroken().addAll(this.configuration.getStringList("auto-updater.on-broken"));

/* 214 */ this.updater.getOnUpdate().addAll(this.configuration.getStringList("auto-updater.on-update"));

/* 215 */ this.updater.check(this.serverVersion);

/* */

/* 217 */ loadPlugins();

/* 218 */ enablePlugins(PluginLoadOrder.STARTUP);

/* */ }

/* */

/* */ private File getConfigFile() {

/* 222 */ return (File)this.console.options.valueOf("bukkit-settings");

/* */ }

/* */

/* */ private void saveConfig() {

/* */ try {

/* 227 */ this.configuration.save(getConfigFile());

/* */ } catch (IOException ex) {

/* 229 */ Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "Could not save " + getConfigFile(), ex);

/* */ }

/* */ }

/* */

/* */ public void loadPlugins() {

/* 234 */ this.pluginManager.registerInterface(JavaPluginLoader.class);

/* */

/* 236 */ File pluginFolder = (File)this.console.options.valueOf("plugins");

/* */

/* 238 */ if (pluginFolder.exists()) {

/* 239 */ Plugin[] plugins = this.pluginManager.loadPlugins(pluginFolder);

/* 240 */ for (Plugin plugin : plugins)

/* */ try {

/* 242 */ String message = String.format("Loading %s", new Object[] { plugin.getDescription().getFullName() });

/* 243 */ plugin.getLogger().info(message);

/* 244 */ plugin.onload();

/* */ } catch (Throwable ex) {

/* 246 */ Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);

/* */ }

/* */ }

/* */ else {

/* 250 */ pluginFolder.mkdir();

/* */ }

/* */ }

/* */

/* */ public void enablePlugins(PluginLoadOrder type) {

/* 255 */ if (type == PluginLoadOrder.STARTUP) {

/* 256 */ this.helpMap.clear();

/* 257 */ this.helpMap.initializeGeneralTopics();

/* */ }

/* */

/* 260 */ Plugin[] plugins = this.pluginManager.getPlugins();

/* */

/* 262 */ for (Plugin plugin : plugins) {

/* 263 */ if ((!plugin.isEnabled()) && (plugin.getDescription().getLoad() == type)) {

/* 264 */ loadPlugin(plugin);

/* */ }

/* */ }

/* */

/* 268 */ if (type == PluginLoadOrder.POSTWORLD) {

/* 269 */ this.commandMap.registerServerAliases();

/* 270 */ loadCustomPermissions();

/* 271 */ DefaultPermissions.registerCorePermissions();

/* 272 */ this.helpMap.initializeCommands();

/* */ }

/* */ }

/* */

/* */ public void disablePlugins() {

/* 277 */ this.pluginManager.disablePlugins();

/* */ }

/* */

/* */ private void loadPlugin(Plugin plugin) {

/* */ try {

/* 282 */ this.pluginManager.enablePlugin(plugin);

/* */

/* 284 */ List perms = plugin.getDescription().getPermissions();

/* */

/* 286 */ for (Permission perm : perms)

/* */ try {

/* 288 */ this.pluginManager.addPermission(perm);

/* */ } catch (IllegalArgumentException ex) {

/* 290 */ getLogger().log(Level.WARNING, "Plugin " + plugin.getDescription().getFullName() + " tried to register permission '" + perm.getName() + "' but it's already registered", ex);

/* */ }

/* */ }

/* */ catch (Throwable ex) {

/* 294 */ Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " loading " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);

/* */ }

/* */ }

/* */

/* */ public String getName() {

/* 299 */ return "CraftBukkit";

/* */ }

/* */

/* */ public String getVersion() {

/* 303 */ return this.serverVersion + " (MC: " + this.console.getVersion() + ")";

/* */ }

/* */

/* */ public String getBukkitVersion() {

/* 307 */ return this.bukkitVersion;

/* */ }

/* */

/* */ public Player[] getOnlinePlayers()

/* */ {

/* 312 */ List online = this.playerList.players;

/* 313 */ Player[] players = new Player[online.size()];

/* */

/* 315 */ for (int i = 0; i < players.length; i++) {

/* 316 */ players = ((EntityPlayer)online.get(i)).playerConnection.getPlayer();

/* */ }

/* */

/* 319 */ return players;

/* */ }

/* */

/* */ public Player getPlayer(String name) {

/* 323 */ Player[] players = getOnlinePlayers();

/* */

/* 325 */ Player found = null;

/* 326 */ String lowerName = name.toLowerCase();

/* 327 */ int delta = 2147483647;

/* 328 */ for (Player player : players)

/* 329 */ if (player.getName().toLowerCase().startsWith(lowerName)) {

/* 330 */ int curDelta = player.getName().length() - lowerName.length();

/* 331 */ if (curDelta < delta) {

/* 332 */ found = player;

/* 333 */ delta = curDelta;

/* */ }

/* 335 */ if (curDelta == 0)

/* */ break;

/* */ }

/* 338 */ return found;

/* */ }

/* */

/* */ public Player getPlayerExact(String name) {

/* 342 */ String lname = name.toLowerCase();

/* */

/* 344 */ for (Player player : getOnlinePlayers()) {

/* 345 */ if (player.getName().equalsIgnoreCase(lname)) {

/* 346 */ return player;

/* */ }

/* */ }

/* */

/* 350 */ return null;

/* */ }

/* */

/* */ public int broadcastMessage(String message) {

/* 354 */ return broadcast(message, "bukkit.broadcast.user");

/* */ }

/* */

/* */ public Player getPlayer(EntityPlayer entity) {

/* 358 */ return entity.playerConnection.getPlayer();

/* */ }

/* */

/* */ public List matchPlayer(String partialName) {

/* 362 */ List matchedPlayers = new ArrayList();

/* */

/* 364 */ for (Player iterPlayer : getOnlinePlayers()) {

/* 365 */ String iterPlayerName = iterPlayer.getName();

/* */

/* 367 */ if (partialName.equalsIgnoreCase(iterPlayerName))

/* */ {

/* 369 */ matchedPlayers.clear();

/* 370 */ matchedPlayers.add(iterPlayer);

/* 371 */ break;

/* */ }

/* 373 */ if (iterPlayerName.toLowerCase().contains(partialName.toLowerCase()))

/* */ {

/* 375 */ matchedPlayers.add(iterPlayer);

/* */ }

/* */ }

/* */

/* 379 */ return matchedPlayers;

/* */ }

/* */

/* */ public int getMaxPlayers() {

/* 383 */ return this.playerList.getMaxPlayers();

/* */ }

/* */

/* */ public int getPort()

/* */ {

/* 389 */ return getConfigInt("server-port", 25565);

/* */ }

/* */

/* */ public int getViewDistance() {

/* 393 */ return getConfigInt("view-distance", 10);

/* */ }

/* */

/* */ public String getIp() {

/* 397 */ return getConfigString("server-ip", "");

/* */ }

/* */

/* */ public String getServerName() {

/* 401 */ return getConfigString("server-name", "Unknown Server");

/* */ }

/* */

/* */ public String getServerId() {

/* 405 */ return getConfigString("server-id", "unnamed");

/* */ }

/* */

/* */ public String getWorldType() {

/* 409 */ return getConfigString("level-type", "DEFAULT");

/* */ }

/* */

/* */ public boolean getGenerateStructures() {

/* 413 */ return getConfigBoolean("generate-structures", true);

/* */ }

/* */

/* */ public boolean getAllowEnd() {

/* 417 */ return this.configuration.getBoolean("settings.allow-end");

/* */ }

/* */

/* */ public boolean getAllowNether() {

/* 421 */ return getConfigBoolean("allow-nether", true);

/* */ }

/* */

/* */ public boolean getWarnOnOverload() {

/* 425 */ return this.configuration.getBoolean("settings.warn-on-overload");

/* */ }

/* */

/* */ public boolean getQueryPlugins() {

/* 429 */ return this.configuration.getBoolean("settings.query-plugins");

/* */ }

/* */

/* */ public boolean hasWhitelist() {

/* 433 */ return getConfigBoolean("white-list", false);

/* */ }

/* */

/* */ private String getConfigString(String variable, String defaultValue)

/* */ {

/* 438 */ return this.console.getPropertyManager().getString(variable, defaultValue);

/* */ }

/* */

/* */ private int getConfigInt(String variable, int defaultValue) {

/* 442 */ return this.console.getPropertyManager().getInt(variable, defaultValue);

/* */ }

/* */

/* */ private boolean getConfigBoolean(String variable, boolean defaultValue) {

/* 446 */ return this.console.getPropertyManager().getBoolean(variable, defaultValue);

/* */ }

/* */

/* */ public String getUpdateFolder()

/* */ {

/* 452 */ return this.configuration.getString("settings.update-folder", "update");

/* */ }

/* */

/* */ public File getUpdateFolderFile() {

/* 456 */ return new File((File)this.console.options.valueOf("plugins"), this.configuration.getString("settings.update-folder", "update"));

/* */ }

/* */

/* */ public int getPingPacketLimit() {

/* 460 */ return this.configuration.getInt("settings.ping-packet-limit", 100);

/* */ }

/* */

/* */ public long getConnectionThrottle() {

/* 464 */ return this.configuration.getInt("settings.connection-throttle");

/* */ }

/* */

/* */ public int getTicksPerAnimalSpawns() {

/* 468 */ return this.configuration.getInt("ticks-per.animal-spawns");

/* */ }

/* */

/* */ public int getTicksPerMonsterSpawns() {

/* 472 */ return this.configuration.getInt("ticks-per.monster-spawns");

/* */ }

/* */

/* */ public PluginManager getPluginManager() {

/* 476 */ return this.pluginManager;

/* */ }

/* */

/* */ public CraftScheduler getScheduler() {

/* 480 */ return this.scheduler;

/* */ }

/* */

/* */ public ServicesManager getServicesManager() {

/* 484 */ return this.servicesManager;

/* */ }

/* */

/* */ public List getWorlds() {

/* 488 */ return new ArrayList(this.worlds.values());

/* */ }

/* */

/* */ public DedicatedPlayerList getHandle() {

/* 492 */ return this.playerList;

/* */ }

/* */

/* */ public boolean dispatchServerCommand(CommandSender sender, ServerCommand serverCommand)

/* */ {

/* 497 */ if ((sender instanceof Conversable)) {

/* 498 */ Conversable conversable = (Conversable)sender;

/* */

/* 500 */ if (conversable.isConversing()) {

/* 501 */ conversable.acceptConversationInput(serverCommand.command);

/* 502 */ return true;

/* */ }

/* */ }

/* */ try {

/* 506 */ return dispatchCommand(sender, serverCommand.command);

/* */ } catch (Exception ex) {

/* 508 */ getLogger().log(Level.WARNING, "Unexpected exception while parsing console command \"" + serverCommand.command + '"', ex);

/* 509 */ }return false;

/* */ }

/* */

/* */ public boolean dispatchCommand(CommandSender sender, String commandLine)

/* */ {

/* 514 */ if (this.commandMap.dispatch(sender, commandLine)) {

/* 515 */ return true;

/* */ }

/* */

/* 518 */ sender.sendMessage("Nie znana komenda!");

/* */

/* 520 */ return false;

/* */ }

/* */

/* */ public void reload() {

/* 524 */ this.configuration = YamlConfiguration.loadConfiguration(getConfigFile());

/* 525 */ PropertyManager config = new PropertyManager(this.console.options);

/* */

/* 527 */ ((DedicatedServer)this.console).propertyManager = config;

/* */

/* 529 */ boolean animals = config.getBoolean("spawn-animals", this.console.getSpawnAnimals());

/* 530 */ boolean monsters = config.getBoolean("spawn-monsters", ((WorldServer)this.console.worlds.get(0)).difficulty > 0);

/* 531 */ int difficulty = config.getInt("difficulty", ((WorldServer)this.console.worlds.get(0)).difficulty);

/* */

/* 533 */ this.online.value = config.getBoolean("online-mode", this.console.getOnlineMode());

/* 534 */ this.console.setSpawnAnimals(config.getBoolean("spawn-animals", this.console.getSpawnAnimals()));

/* 535 */ this.console.setPvP(config.getBoolean("pvp", this.console.getPvP()));

/* 536 */ this.console.setAllowFlight(config.getBoolean("allow-flight", this.console.getAllowFlight()));

/* 537 */ this.console.setMotd(config.getString("motd", this.console.getMotd()));

/* 538 */ this.monsterSpawn = this.configuration.getInt("spawn-limits.monsters");

/* 539 */ this.animalSpawn = this.configuration.getInt("spawn-limits.animals");

/* 540 */ this.waterAnimalSpawn = this.configuration.getInt("spawn-limits.water-animals");

/* 541 */ this.ambientSpawn = this.configuration.getInt("spawn-limits.ambient");

/* 542 */ this.warningState = Warning.WarningState.value(this.configuration.getString("settings.deprecated-verbose"));

/* 543 */ this.console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");

/* 544 */ this.chunkGCPeriod = this.configuration.getInt("chunk-gc.period-in-ticks");

/* 545 */ this.chunkGCLoadThresh = this.configuration.getInt("chunk-gc.load-threshold");

/* */

/* 547 */ for (WorldServer world : this.console.worlds) {

/* 548 */ world.difficulty = difficulty;

/* 549 */ world.setSpawnFlags(monsters, animals);

/* 550 */ if (getTicksPerAnimalSpawns() < 0)

/* 551 */ world.ticksPerAnimalSpawns = 400L;

/* */ else {

/* 553 */ world.ticksPerAnimalSpawns = getTicksPerAnimalSpawns();

/* */ }

/* */

/* 556 */ if (getTicksPerMonsterSpawns() < 0)

/* 557 */ world.ticksPerMonsterSpawns = 1L;

/* */ else {

/* 559 */ world.ticksPerMonsterSpawns = getTicksPerMonsterSpawns();

/* */ }

/* */ }

/* */

/* 563 */ this.pluginManager.clearPlugins();

/* 564 */ this.commandMap.clearCommands();

/* 565 */ resetRecipes();

/* */

/* 567 */ int pollCount = 0;

/* */

/* 570 */ while ((pollCount < 50) && (getScheduler().getActiveWorkers().size() > 0)) {

/* */ try {

/* 572 */ Thread.sleep(50L); } catch (InterruptedException e) {

/* */ }

/* 574 */ pollCount++;

/* */ }

/* */

/* 577 */ List overdueWorkers = getScheduler().getActiveWorkers();

/* 578 */ for (BukkitWorker worker : overdueWorkers) {

/* 579 */ Plugin plugin = worker.getOwner();

/* 580 */ String author = "";

/* 581 */ if (plugin.getDescription().getAuthors().size() > 0) {

/* 582 */ author = (String)plugin.getDescription().getAuthors().get(0);

/* */ }

/* 584 */ getLogger().log(Level.SEVERE, String.format("Nag author: '%s' of '%s' about the following: %s", new Object[] { author, plugin.getDescription().getName(), "This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin" }));

/* */ }

/* */

/* 591 */ loadPlugins();

/* 592 */ enablePlugins(PluginLoadOrder.STARTUP);

/* 593 */ enablePlugins(PluginLoadOrder.POSTWORLD);

/* */ }

/* */

/* */ private void loadCustomPermissions()

/* */ {

/* 598 */ File file = new File(this.configuration.getString("settings.permissions-file"));

/* */ FileInputStream stream;

/* */ try {

/* 602 */ stream = new FileInputStream(file);

/* */ } catch (FileNotFoundException ex) {

/* */ try {

/* 605 */ file.createNewFile();

/* */ }

/* */ finally

/* */ {

/* */ return;

/* */ }

/* */ }

/* */ Map perms;

/* */ try {

/* 614 */ perms = (Map)this.yaml.load(stream); } catch (MarkedYAMLException ex) { getLogger().log(Level.WARNING, "Server permissions file " + file + " is not valid YAML: " + ex.toString());

/* */ return;

/* */ } catch (Throwable ex) { getLogger().log(Level.WARNING, "Server permissions file " + file + " is not valid YAML.", ex);

/* */ return;

/* */ }

/* */ finally {

/* */ try {

/* 623 */ stream.close();

/* */ } catch (IOException ex) {

/* */ }

/* */ }

/* 627 */ if (perms == null) {

/* 628 */ getLogger().log(Level.INFO, "Server permissions file " + file + " is empty, ignoring it");

/* 629 */ return;

/* */ }

/* */

/* 632 */ List permsList = Permission.loadPermissions(perms, "Permission node '%s' in " + file + " is invalid", Permission.DEFAULT_PERMISSION);

/* */

/* 634 */ for (Permission perm : permsList)

/* */ try {

/* 636 */ this.pluginManager.addPermission(perm);

/* */ } catch (IllegalArgumentException ex) {

/* 638 */ getLogger().log(Level.SEVERE, "Permission in " + file + " was already defined", ex);

/* */ }

/* */ }

/* */

/* */ public String toString()

/* */ {

/* 645 */ return "CraftServer{serverName=CraftBukkit,serverVersion=" + this.serverVersion + ",minecraftVersion=" + this.console.getVersion() + '}';

/* */ }

/* */

/* */ public World createWorld(String name, World.Environment environment) {

/* 649 */ return WorldCreator.name(name).environment(environment).createWorld();

/* */ }

/* */

/* */ public World createWorld(String name, World.Environment environment, long seed) {

/* 653 */ return WorldCreator.name(name).environment(environment).seed(seed).createWorld();

/* */ }

/* */

/* */ public World createWorld(String name, World.Environment environment, ChunkGenerator generator) {

/* 657 */ return WorldCreator.name(name).environment(environment).generator(generator).createWorld();

/* */ }

/* */

/* */ public World createWorld(String name, World.Environment environment, long seed, ChunkGenerator generator) {

/* 661 */ return WorldCreator.name(name).environment(environment).seed(seed).generator(generator).createWorld();

/* */ }

/* */

/* */ public World createWorld(WorldCreator creator) {

/* 665 */ if (creator == null) {

/* 666 */ throw new IllegalArgumentException("Creator may not be null");

/* */ }

/* */

/* 669 */ String name = creator.name();

/* 670 */ ChunkGenerator generator = creator.generator();

/* 671 */ File folder = new File(getWorldContainer(), name);

/* 672 */ World world = getWorld(name);

/* 673 */ net.minecraft.server.v1_4_R1.WorldType type = net.minecraft.server.v1_4_R1.WorldType.getType(creator.type().getName());

/* 674 */ boolean generateStructures = creator.generateStructures();

/* */

/* 676 */ if (world != null) {

/* 677 */ return world;

/* */ }

/* */

/* 680 */ if ((folder.exists()) && (!folder.isDirectory())) {

/* 681 */ throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");

/* */ }

/* */

/* 684 */ if (generator == null) {

/* 685 */ generator = getGenerator(name);

/* */ }

/* */

/* 688 */ Convertable converter = new WorldLoaderServer(getWorldContainer());

/* 689 */ if (converter.isConvertable(name)) {

/* 690 */ getLogger().info("Converting world '" + name + "'");

/* 691 */ converter.convert(name, new ConvertProgressUpdater(this.console));

/* */ }

/* */

/* 694 */ int dimension = 10 + this.console.worlds.size();

/* 695 */ boolean used = false;

/* */ do

/* 697 */ for (WorldServer server : this.console.worlds) {

/* 698 */ used = server.dimension == dimension;

/* 699 */ if (used) {

/* 700 */ dimension++;

/* 701 */ break;

/* */ }

/* */ }

/* 704 */ while (used);

/* 705 */ boolean hardcore = false;

/* */

/* 707 */ WorldServer internal = new WorldServer(this.console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), EnumGamemode.a(getDefaultGameMode().getValue()), generateStructures, hardcore, type), this.console.methodProfiler, creator.environment(), generator);

/* */

/* 709 */ if (!this.worlds.containsKey(name.toLowerCase())) {

/* 710 */ return null;

/* */ }

/* */

/* 713 */ internal.worldMaps = ((WorldServer)this.console.worlds.get(0)).worldMaps;

/* */

/* 715 */ internal.tracker = new EntityTracker(internal);

/* 716 */ internal.addIWorldAccess(new WorldManager(this.console, internal));

/* 717 */ internal.difficulty = 1;

/* 718 */ internal.setSpawnFlags(true, true);

/* 719 */ this.console.worlds.add(internal);

/* */

/* 721 */ if (generator != null) {

/* 722 */ internal.getWorld().getPopulators().addAll(generator.getDefaultPopulators(internal.getWorld()));

/* */ }

/* */

/* 725 */ this.pluginManager.callEvent(new WorldInitEvent(internal.getWorld()));

/* 726 */ System.out.print("Preparing start region for level " + (this.console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")");

/* */

/* 728 */ if (internal.getWorld().getKeepSpawnInMemory()) {

/* 729 */ short short1 = 196;

/* 730 */ long i = System.currentTimeMillis();

/* 731 */ for (int j = -short1; j <= short1; j += 16) {

/* 732 */ for (int k = -short1; k <= short1; k += 16) {

/* 733 */ long l = System.currentTimeMillis();

/* */

/* 735 */ if (l < i) {

/* 736 */ i = l;

/* */ }

/* */

/* 739 */ if (l > i + 1000L) {

/* 740 */ int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);

/* 741 */ int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

/* */

/* 743 */ System.out.println("Preparing spawn area for " + name + ", " + j1 * 100 / i1 + "%");

/* 744 */ i = l;

/* */ }

/* */

/* 747 */ ChunkCoordinates chunkcoordinates = internal.getSpawn();

/* 748 */ internal.chunkProviderServer.getChunkAt(chunkcoordinates.x + j >> 4, chunkcoordinates.z + k >> 4);

/* */ }

/* */ }

/* */ }

/* 752 */ this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));

/* 753 */ return internal.getWorld();

/* */ }

/* */

/* */ public boolean unloadWorld(String name, boolean save) {

/* 757 */ return unloadWorld(getWorld(name), save);

/* */ }

/* */

/* */ public boolean unloadWorld(World world, boolean save) {

/* 761 */ if (world == null) {

/* 762 */ return false;

/* */ }

/* */

/* 765 */ WorldServer handle = ((CraftWorld)world).getHandle();

/* */

/* 767 */ if (!this.console.worlds.contains(handle)) {

/* 768 */ return false;

/* */ }

/* */

/* 771 */ if (handle.dimension <= 1) {

/* 772 */ return false;

/* */ }

/* */

/* 775 */ if (handle.players.size() > 0) {

/* 776 */ return false;

/* */ }

/* */

/* 779 */ WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());

/* 780 */ this.pluginManager.callEvent(e);

/* */

/* 782 */ if (e.isCancelled()) {

/* 783 */ return false;

/* */ }

/* */

/* 786 */ if (save) {

/* */ try {

/* 788 */ handle.save(true, (IProgressUpdate)null);

/* 789 */ handle.saveLevel();

/* 790 */ WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());

/* 791 */ getPluginManager().callEvent(event);

/* */ } catch (ExceptionWorldConflict ex) {

/* 793 */ getLogger().log(Level.SEVERE, null, ex);

/* */ }

/* */ }

/* */

/* 797 */ this.worlds.remove(world.getName().toLowerCase());

/* 798 */ this.console.worlds.remove(this.console.worlds.indexOf(handle));

/* */

/* 800 */ return true;

/* */ }

/* */

/* */ public MinecraftServer getServer() {

/* 804 */ return this.console;

/* */ }

/* */

/* */ public World getWorld(String name) {

/* 808 */ return (World)this.worlds.get(name.toLowerCase());

/* */ }

/* */

/* */ public World getWorld(UUID uid) {

/* 812 */ for (World world : this.worlds.values()) {

/* 813 */ if (world.getUID().equals(uid)) {

/* 814 */ return world;

/* */ }

/* */ }

/* 817 */ return null;

/* */ }

/* */

/* */ public void addWorld(World world)

/* */ {

/* 822 */ if (getWorld(world.getUID()) != null) {

/* 823 */ System.out.println("World " + world.getName() + " is a duplicate of another world and has been prevented from loading. Please delete the uid.dat file from " + world.getName() + "'s world directory if you want to be able to load the duplicate world.");

/* 824 */ return;

/* */ }

/* 826 */ this.worlds.put(world.getName().toLowerCase(), world);

/* */ }

/* */

/* */ public Logger getLogger() {

/* 830 */ return MinecraftServer.log;

/* */ }

/* */

/* */ public ConsoleReader getReader() {

/* 834 */ return this.console.reader;

/* */ }

/* */

/* */ public PluginCommand getPluginCommand(String name) {

/* 838 */ Command command = this.commandMap.getCommand(name);

/* */

/* 840 */ if ((command instanceof PluginCommand)) {

/* 841 */ return (PluginCommand)command;

/* */ }

/* 843 */ return null;

/* */ }

/* */

/* */ public void savePlayers()

/* */ {

/* 848 */ this.playerList.savePlayers();

/* */ }

/* */

/* */ public void configureDbConfig(ServerConfig config) {

/* 852 */ DataSourceConfig ds = new DataSourceConfig();

/* 853 */ ds.setDriver(this.configuration.getString("database.driver"));

/* 854 */ ds.setUrl(this.configuration.getString("database.url"));

/* 855 */ ds.setUsername(this.configuration.getString("database.username"));

/* 856 */ ds.setPassword(this.configuration.getString("database.password"));

/* 857 */ ds.setIsolationLevel(TransactionIsolation.getLevel(this.configuration.getString("database.isolation")));

/* */

/* 859 */ if (ds.getDriver().contains("sqlite")) {

/* 860 */ config.setDatabasePlatform(new SQLitePlatform());

/* 861 */ config.getDatabasePlatform().getDbDdlSyntax().setIdentity("");

/* */ }

/* */

/* 864 */ config.setDataSourceConfig(ds);

/* */ }

/* */

/* */ public boolean addRecipe(Recipe recipe)

/* */ {

/* */ CraftRecipe toAdd;

/* 869 */ if ((recipe instanceof CraftRecipe)) {

/* 870 */ toAdd = (CraftRecipe)recipe;

/* */ }

/* */ else

/* */ {

/* */ CraftRecipe toAdd;

/* 872 */ if ((recipe instanceof ShapedRecipe)) {

/* 873 */ toAdd = CraftShapedRecipe.fromBukkitRecipe((ShapedRecipe)recipe);

/* */ }

/* */ else

/* */ {

/* */ CraftRecipe toAdd;

/* 874 */ if ((recipe instanceof ShapelessRecipe)) {

/* 875 */ toAdd = CraftShapelessRecipe.fromBukkitRecipe((ShapelessRecipe)recipe);

/* */ }

/* */ else

/* */ {

/* */ CraftRecipe toAdd;

/* 876 */ if ((recipe instanceof FurnaceRecipe))

/* 877 */ toAdd = CraftFurnaceRecipe.fromBukkitRecipe((FurnaceRecipe)recipe);

/* */ else

/* 879 */ return false;

/* */ }

/* */ }

/* */ }

/* */ CraftRecipe toAdd;

/* 882 */ toAdd.addToCraftingManager();

/* 883 */ CraftingManager.getInstance().sort();

/* 884 */ return true;

/* */ }

/* */

/* */ public List getRecipesFor(org.bukkit.inventory.ItemStack result) {

/* 888 */ List results = new ArrayList();

/* 889 */ Iterator iter = recipeIterator();

/* 890 */ while (iter.hasNext()) {

/* 891 */ Recipe recipe = (Recipe)iter.next();

/* 892 */ org.bukkit.inventory.ItemStack stack = recipe.getResult();

/* 893 */ if (stack.getType() == result.getType())

/* */ {

/* 896 */ if ((result.getDurability() == -1) || (result.getDurability() == stack.getDurability()))

/* 897 */ results.add(recipe);

/* */ }

/* */ }

/* 900 */ return results;

/* */ }

/* */

/* */ public Iterator recipeIterator() {

/* 904 */ return new RecipeIterator();

/* */ }

/* */

/* */ public void clearRecipes() {

/* 908 */ CraftingManager.getInstance().recipes.clear();

/* 909 */ RecipesFurnace.getInstance().recipes.clear();

/* */ }

/* */

/* */ public void resetRecipes() {

/* 913 */ CraftingManager.getInstance().recipes = new CraftingManager().recipes;

/* 914 */ RecipesFurnace.getInstance().recipes = new RecipesFurnace().recipes;

/* */ }

/* */

/* */ public Map getCommandAliases() {

/* 918 */ ConfigurationSection section = this.configuration.getConfigurationSection("aliases");

/* 919 */ Map result = new LinkedHashMap();

/* */

/* 921 */ if (section != null) {

/* 922 */ for (String key : section.getKeys(false)) {

/* 923 */ List commands = null;

/* */

/* 925 */ if (section.isList(key))

/* 926 */ commands = section.getStringList(key);

/* */ else {

/* 928 */ commands = ImmutableList.of(section.getString(key));

/* */ }

/* */

/* 931 */ result.put(key, commands.toArray(new String[commands.size()]));

/* */ }

/* */ }

/* */

/* 935 */ return result;

/* */ }

/* */

/* */ public void removeBukkitSpawnRadius() {

/* 939 */ this.configuration.set("settings.spawn-radius", null);

/* 940 */ saveConfig();

/* */ }

/* */

/* */ public int getBukkitSpawnRadius() {

/* 944 */ return this.configuration.getInt("settings.spawn-radius", -1);

/* */ }

/* */

/* */ public String getShutdownMessage() {

/* 948 */ return this.configuration.getString("settings.shutdown-message");

/* */ }

/* */

/* */ public int getSpawnRadius() {

/* 952 */ return ((DedicatedServer)this.console).propertyManager.getInt("spawn-protection", 16);

/* */ }

/* */

/* */ public void setSpawnRadius(int value) {

/* 956 */ this.configuration.set("settings.spawn-radius", Integer.valueOf(value));

/* 957 */ saveConfig();

/* */ }

/* */

/* */ public boolean getOnlineMode() {

/* 961 */ return this.online.value;

/* */ }

/* */

/* */ public boolean getAllowFlight() {

/* 965 */ return this.console.getAllowFlight();

/* */ }

/* */

/* */ public boolean isHardcore() {

/* 969 */ return this.console.isHardcore();

/* */ }

/* */

/* */ public boolean useExactLoginLocation() {

/* 973 */ return this.configuration.getBoolean("settings.use-exact-login-location");

/* */ }

/* */

/* */ public ChunkGenerator getGenerator(String world) {

/* 977 */ ConfigurationSection section = this.configuration.getConfigurationSection("worlds");

/* 978 */ ChunkGenerator result = null;

/* */

/* 980 */ if (section != null) {

/* 981 */ section = section.getConfigurationSection(world);

/* */

/* 983 */ if (section != null) {

/* 984 */ String name = section.getString("generator");

/* */

/* 986 */ if ((name != null) && (!name.equals(""))) {

/* 987 */ String[] split = name.split(":", 2);

/* 988 */ String id = split.length > 1 ? split[1] : null;

/* 989 */ Plugin plugin = this.pluginManager.getPlugin(split[0]);

/* */

/* 991 */ if (plugin == null)

/* 992 */ getLogger().severe("Could not set generator for default world '" + world + "': Plugin '" + split[0] + "' does not exist");

/* 993 */ else if (!plugin.isEnabled())

/* 994 */ getLogger().severe("Could not set generator for default world '" + world + "': Plugin '" + split[0] + "' is not enabled yet (is it load:STARTUP?)");

/* */ else {

/* 996 */ result = plugin.getDefaultWorldGenerator(world, id);

/* */ }

/* */ }

/* */ }

/* */ }

/* */

/* 1002 */ return result;

/* */ }

/* */

/* */ public CraftMapView getMap(short id) {

/* 1006 */ WorldMapCollection collection = ((WorldServer)this.console.worlds.get(0)).worldMaps;

/* 1007 */ WorldMap worldmap = (WorldMap)collection.get(WorldMap.class, "map_" + id);

/* 1008 */ if (worldmap == null) {

/* 1009 */ return null;

/* */ }

/* 1011 */ return worldmap.mapView;

/* */ }

/* */

/* */ public CraftMapView createMap(World world) {

/* 1015 */ net.minecraft.server.v1_4_R1.ItemStack stack = new net.minecraft.server.v1_4_R1.ItemStack(Item.MAP, 1, -1);

/* 1016 */ WorldMap worldmap = Item.MAP.getSavedMap(stack, ((CraftWorld)world).getHandle());

/* 1017 */ return worldmap.mapView;

/* */ }

/* */

/* */ public void shutdown() {

/* 1021 */ this.console.safeShutdown();

/* */ }

/* */

/* */ public int broadcast(String message, String permission) {

/* 1025 */ int count = 0;

/* 1026 */ Set permissibles = getPluginManager().getPermissionSubscriptions(permission);

/* */

/* 1028 */ for (Permissible permissible : permissibles) {

/* 1029 */ if (((permissible instanceof CommandSender)) && (permissible.hasPermission(permission))) {

/* 1030 */ CommandSender user = (CommandSender)permissible;

/* 1031 */ user.sendMessage(message);

/* 1032 */ count++;

/* */ }

/* */ }

/* */

/* 1036 */ return count;

/* */ }

/* */

/* */ public OfflinePlayer getOfflinePlayer(String name) {

/* 1040 */ return getOfflinePlayer(name, true);

/* */ }

/* */

/* */ public OfflinePlayer getOfflinePlayer(String name, boolean search) {

/* 1044 */ OfflinePlayer result = getPlayerExact(name);

/* 1045 */ String lname = name.toLowerCase();

/* */

/* 1047 */ if (result == null) {

/* 1048 */ result = (OfflinePlayer)this.offlinePlayers.get(lname);

/* */

/* 1050 */ if (result == null) {

/* 1051 */ if (search) {

/* 1052 */ WorldNBTStorage storage = (WorldNBTStorage)((WorldServer)this.console.worlds.get(0)).getDataManager();

/* 1053 */ for (String dat : storage.getPlayerDir().list(new DatFileFilter())) {

/* 1054 */ String datName = dat.substring(0, dat.length() - 4);

/* 1055 */ if (datName.equalsIgnoreCase(name)) {

/* 1056 */ name = datName;

/* 1057 */ break;

/* */ }

/* */ }

/* */ }

/* */

/* 1062 */ result = new CraftOfflinePlayer(this, name);

/* 1063 */ this.offlinePlayers.put(lname, result);

/* */ }

/* */ } else {

/* 1066 */ this.offlinePlayers.remove(lname);

/* */ }

/* */

/* 1069 */ return result;

/* */ }

/* */

/* */ public Set getIPBans()

/* */ {

/* 1074 */ return this.playerList.getIPBans().getEntries().keySet();

/* */ }

/* */

/* */ public void banIP(String address) {

/* 1078 */ BanEntry entry = new BanEntry(address);

/* 1079 */ this.playerList.getIPBans().add(entry);

/* 1080 */ this.playerList.getIPBans().save();

/* */ }

/* */

/* */ public void unbanIP(String address) {

/* 1084 */ this.playerList.getIPBans().remove(address);

/* 1085 */ this.playerList.getIPBans().save();

/* */ }

/* */

/* */ public Set getBannedPlayers() {

/* 1089 */ Set result = new HashSet();

/* */

/* 1091 */ for (Iterator i$ = this.playerList.getNameBans().getEntries().keySet().iterator(); i$.hasNext(); ) { Object name = i$.next();

/* 1092 */ result.add(getOfflinePlayer((String)name));

/* */ }

/* */

/* 1095 */ return result;

/* */ }

/* */

/* */ public void setWhitelist(boolean value) {

/* 1099 */ this.playerList.hasWhitelist = value;

/* 1100 */ this.console.getPropertyManager().a("white-list", Boolean.valueOf(value));

/* */ }

/* */

/* */ public Set getWhitelistedPlayers() {

/* 1104 */ Set result = new LinkedHashSet();

/* */

/* 1106 */ for (Iterator i$ = this.playerList.getWhitelisted().iterator(); i$.hasNext(); ) { Object name = i$.next();

/* 1107 */ if ((((String)name).length() != 0) && (!((String)name).startsWith("#")))

/* */ {

/* 1110 */ result.add(getOfflinePlayer((String)name));

/* */ }

/* */ }

/* 1113 */ return result;

/* */ }

/* */

/* */ public Set getOperators() {

/* 1117 */ Set result = new HashSet();

/* */

/* 1119 */ for (Iterator i$ = this.playerList.getOPs().iterator(); i$.hasNext(); ) { Object name = i$.next();

/* 1120 */ result.add(getOfflinePlayer((String)name));

/* */ }

/* */

/* 1123 */ return result;

/* */ }

/* */

/* */ public void reloadWhitelist() {

/* 1127 */ this.playerList.reloadWhitelist();

/* */ }

/* */

/* */ public GameMode getDefaultGameMode() {

/* 1131 */ return GameMode.getByValue(((WorldServer)this.console.worlds.get(0)).getWorldData().getGameType().a());

/* */ }

/* */

/* */ public void setDefaultGameMode(GameMode mode) {

/* 1135 */ if (mode == null) {

/* 1136 */ throw new IllegalArgumentException("Mode cannot be null");

/* */ }

/* */

/* 1139 */ for (World world : getWorlds())

/* 1140 */ ((CraftWorld)world).getHandle().worldData.setGameType(EnumGamemode.a(mode.getValue()));

/* */ }

/* */

/* */ public ConsoleCommandSender getConsoleSender()

/* */ {

/* 1145 */ return this.console.console;

/* */ }

/* */

/* */ public EntityMetadataStore getEntityMetadata() {

/* 1149 */ return this.entityMetadata;

/* */ }

/* */

/* */ public PlayerMetadataStore getPlayerMetadata() {

/* 1153 */ return this.playerMetadata;

/* */ }

/* */

/* */ public WorldMetadataStore getWorldMetadata() {

/* 1157 */ return this.worldMetadata;

/* */ }

/* */

/* */ public void detectListNameConflict(EntityPlayer entityPlayer)

/* */ {

/* 1162 */ for (int i = 0; i < getHandle().players.size(); i++) {

/* 1163 */ EntityPlayer testEntityPlayer = (EntityPlayer)getHandle().players.get(i);

/* */

/* 1166 */ if ((testEntityPlayer != entityPlayer) && (testEntityPlayer.listName.equals(entityPlayer.listName))) {

/* 1167 */ String oldName = entityPlayer.listName;

/* 1168 */ int spaceLeft = 16 - oldName.length();

/* */

/* 1170 */ if (spaceLeft <= 1)

/* 1171 */ entityPlayer.listName = (oldName.subSequence(0, oldName.length() - 2 - spaceLeft) + String.valueOf(System.currentTimeMillis() % 99L));

/* */ else {

/* 1173 */ entityPlayer.listName = (oldName + String.valueOf(System.currentTimeMillis() % 99L));

/* */ }

/* */

/* 1176 */ return;

/* */ }

/* */ }

/* */ }

/* */

/* */ public File getWorldContainer() {

/* 1182 */ if (getServer().universe != null) {

/* 1183 */ return getServer().universe;

/* */ }

/* */

/* 1186 */ if (this.container == null) {

/* 1187 */ this.container = new File(this.configuration.getString("settings.world-container", "."));

/* */ }

/* */

/* 1190 */ return this.container;

/* */ }

/* */

/* */ public OfflinePlayer[] getOfflinePlayers() {

/* 1194 */ WorldNBTStorage storage = (WorldNBTStorage)((WorldServer)this.console.worlds.get(0)).getDataManager();

/* 1195 */ String[] files = storage.getPlayerDir().list(new DatFileFilter());

/* 1196 */ Set players = new HashSet();

/* */

/* 1198 */ for (String file : files) {

/* 1199 */ players.add(getOfflinePlayer(file.substring(0, file.length() - 4), false));

/* */ }

/* 1201 */ players.addAll(Arrays.asList(getOnlinePlayers()));

/* */

/* 1203 */ return (OfflinePlayer[])players.toArray(new OfflinePlayer[players.size()]);

/* */ }

/* */

/* */ public Messenger getMessenger() {

/* 1207 */ return this.messenger;

/* */ }

/* */

/* */ public void sendPluginMessage(Plugin source, String channel, byte[] message) {

/* 1211 */ StandardMessenger.validatePluginMessage(getMessenger(), source, channel, message);

/* */

/* 1213 */ for (Player player : getOnlinePlayers())

/* 1214 */ player.sendPluginMessage(source, channel, message);

/* */ }

/* */

/* */ public Set getListeningPluginChannels()

/* */ {

/* 1219 */ Set result = new HashSet();

/* */

/* 1221 */ for (Player player : getOnlinePlayers()) {

/* 1222 */ result.addAll(player.getListeningPluginChannels());

/* */ }

/* */

/* 1225 */ return result;

/* */ }

/* */

/* */ public void onPlayerJoin(Player player) {

/* 1229 */ if ((this.updater.isEnabled()) && (this.updater.getCurrent() != null) && (player.hasPermission("bukkit.broadcast.admin")))

/* 1230 */ if ((this.updater.getCurrent().isBroken()) && (this.updater.getOnBroken().contains("warn-ops")))

/* 1231 */ player.sendMessage(ChatColor.DARK_RED + "The version of CraftBukkit that this server is running is known to be broken. Please consider updating to the latest version at dl.bukkit.org.");

/* 1232 */ else if ((this.updater.isUpdateAvailable()) && (this.updater.getOnUpdate().contains("warn-ops")))

/* 1233 */ player.sendMessage(ChatColor.DARK_PURPLE + "The version of CraftBukkit that this server is running is out of date. Please consider updating to the latest version at dl.bukkit.org.");

/* */ }

/* */

/* */ public Inventory createInventory(InventoryHolder owner, InventoryType type)

/* */ {

/* 1240 */ return new CraftInventoryCustom(owner, type);

/* */ }

/* */

/* */ public Inventory createInventory(InventoryHolder owner, int size) throws IllegalArgumentException {

/* 1244 */ Validate.isTrue(size % 9 == 0, "Chests must have a size that is a multiple of 9!");

/* 1245 */ return new CraftInventoryCustom(owner, size);

/* */ }

/* */

/* */ public Inventory createInventory(InventoryHolder owner, int size, String title) throws IllegalArgumentException {

/* 1249 */ Validate.isTrue(size % 9 == 0, "Chests must have a size that is a multiple of 9!");

/* 1250 */ return new CraftInventoryCustom(owner, size, title);

/* */ }

/* */

/* */ public HelpMap getHelpMap() {

/* 1254 */ return this.helpMap;

/* */ }

/* */

/* */ public SimpleCommandMap getCommandMap() {

/* 1258 */ return this.commandMap;

/* */ }

/* */

/* */ public int getMonsterSpawnLimit() {

/* 1262 */ return this.monsterSpawn;

/* */ }

/* */

/* */ public int getAnimalSpawnLimit() {

/* 1266 */ return this.animalSpawn;

/* */ }

/* */

/* */ public int getWaterAnimalSpawnLimit() {

/* 1270 */ return this.waterAnimalSpawn;

/* */ }

/* */

/* */ public int getAmbientSpawnLimit() {

/* 1274 */ return this.ambientSpawn;

/* */ }

/* */

/* */ public boolean isPrimaryThread() {

/* 1278 */ return Thread.currentThread().equals(this.console.primaryThread);

/* */ }

/* */

/* */ public String getMotd() {

/* 1282 */ return this.console.getMotd();

/* */ }

/* */

/* */ public Warning.WarningState getWarningState() {

/* 1286 */ return this.warningState;

/* */ }

/* */

/* */ public List tabComplete(ICommandListener sender, String message) {

/* 1290 */ if (!(sender instanceof EntityPlayer)) {

/* 1291 */ return ImmutableList.of();

/* */ }

/* */

/* 1294 */ Player player = ((EntityPlayer)sender).getBukkitEntity();

/* 1295 */ if (message.startsWith("/")) {

/* 1296 */ return tabCompleteCommand(player, message);

/* */ }

/* 1298 */ return tabCompleteChat(player, message);

/* */ }

/* */

/* */ public List tabCompleteCommand(Player player, String message)

/* */ {

/* 1303 */ List completions = null;

/* */ try {

/* 1305 */ completions = getCommandMap().tabComplete(player, message.substring(1));

/* */ } catch (CommandException ex) {

/* 1307 */ player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to tab-complete this command");

/* 1308 */ getLogger().log(Level.SEVERE, "Exception when " + player.getName() + " attempted to tab complete " + message, ex);

/* */ }

/* */

/* 1311 */ return completions == null ? ImmutableList.of() : completions;

/* */ }

/* */

/* */ public List tabCompleteChat(Player player, String message) {

/* 1315 */ Player[] players = getOnlinePlayers();

/* 1316 */ List completions = new ArrayList();

/* 1317 */ PlayerChatTabCompleteEvent event = new PlayerChatTabCompleteEvent(player, message, completions);

/* 1318 */ String token = event.getLastToken();

/* 1319 */ for (Player p : players) {

/* 1320 */ if ((player.canSee(p)) && (StringUtil.startsWithIgnoreCase(p.getName(), token))) {

/* 1321 */ completions.add(p.getName());

/* */ }

/* */ }

/* 1324 */ this.pluginManager.callEvent(event);

/* */

/* 1326 */ Iterator it = completions.iterator();

/* 1327 */ while (it.hasNext()) {

/* 1328 */ Object current = it.next();

/* 1329 */ if (!(current instanceof String))

/* */ {

/* 1331 */ it.remove();

/* */ }

/* */ }

/* 1334 */ Collections.sort(completions, String.CASE_INSENSITIVE_ORDER);

/* 1335 */ return completions;

/* */ }

/* */

/* */ public CraftItemFactory getItemFactory() {

/* 1339 */ return CraftItemFactory.instance();

/* */ }

/* */

/* */ static

/* */ {

/* 171 */ ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);

/* 172 */ CraftItemFactory.instance();

/* */ }

/* */

/* */ private final class BooleanWrapper

/* */ {

/* 167 */ private boolean value = true;

/* */

/* */ private BooleanWrapper()

/* */ {

/* */ }

/* */ }

/* */ }

 

/* Location: C:\Documents and Settings\Ewa\Pulpit\craftbukit\

* Qualified Name: org.bukkit.craftbukkit.v1_4_R1.CraftServer

* JD-Core Version: 0.6.2

*/

 

Opublikowano

Spróbuj to zrobić w eclipse, czasami z JDK sam miałem problemy z kompilacją, a powinno być wszystko dobrze. W errorze, masz problem z paczkami, a eclipse sam robi paczki, wiec problemu być nie powinno ;]

//gif w sygnie

Opublikowano

Nie masz dodanych bibliotek -,-

 

Naucz się podstaw javy a później coś rób bo takie pierdoły...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...